package com.gzhryc.net_marketing.cloud.business.dao.db;

import com.gzhryc.jdbc.annotaion.Column;
import com.gzhryc.jdbc.annotaion.Id;
import com.gzhryc.jdbc.annotaion.Table;
import com.gzhryc.jdbc.annotaion.UniqueKey;
import com.gzhryc.net_marketing.cloud.business.dao.enums.MarketProjectAppEnum;
import com.gzhryc.shared_device.common.payment.dao.enums.EAppType;

import java.util.Date;

@Table(name="market_project_app")
public class MarketProjectApp {

    @Id(autoIncrement = 90000)
    @Column(notNull = true,note="应用ID")
    protected Long id;

    @Column(notNull = true,length=32,note="应用名称")
    protected String name;

    @UniqueKey
    @Column(name="account_id",notNull = true,note="云支付账号ID")
    protected Long accountId;
    
    @Column(name="app_type",notNull = true,note="应用类型")
    protected Integer appType;
    
    @Column(name="app_id",notNull = true,note="应用ID")
    protected String appId;

    @Column(name = "db_config", length = 1024, note = "数据库配置")
    protected String dbConfig;

    @Column(name="state",notNull = true,defVal = "1",note="状态")
    protected Integer state;

    @Column(name = "update_date", autoUpdateTime = true, note = "最后修改时间")
    protected Date updateDate;

    @Column(name = "create_date")
    protected Date createDate;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Long getAccountId() {
        return accountId;
    }

    public void setAccountId(Long accountId) {
        this.accountId = accountId;
    }

    public Integer getAppType() {
		return appType;
	}

	public void setAppType(Integer appType) {
		this.appType = appType;
	}

	public String getAppId() {
		return appId;
	}

	public void setAppId(String appId) {
		this.appId = appId;
	}

	public String getDbConfig() {
        return dbConfig;
    }

    public void setDbConfig(String dbConfig) {
        this.dbConfig = dbConfig;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public Date getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public String getStateName(){
        return MarketProjectAppEnum.State.note(this.state);
    }
    
    public String getAppTypeName() {
    	return EAppType.note(this.appType);
    }
}
